-- ----------------------------
--  Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS sys_dept;
CREATE TABLE sys_dept (
  dept_id SERIAL NOT NULL,
  name varchar(128) DEFAULT NULL,
  dept_code varchar(50) DEFAULT NULL,
  sort INTEGER NOT NULL DEFAULT '0',
  create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  del_flag char(1) DEFAULT '0',
  parent_id INTEGER DEFAULT NULL,
  remark varchar(512) DEFAULT NULL,
  tenant_id INTEGER NOT NULL DEFAULT '0',
  PRIMARY KEY (dept_id)
);
comment on table sys_dept is '部门管理';
comment on column sys_dept.name is '部门名称';
comment on column sys_dept.dept_code is '部门编码';
comment on column sys_dept.sort is '排序';
comment on column sys_dept.create_time is '创建时间';
comment on column sys_dept.update_time is '修改时间';
comment on column sys_dept.del_flag is '是否删除  -1：已删除  0：正常';
comment on column sys_dept.remark is '简介';
comment on column sys_dept.tenant_id is '所属租户';

-- ----------------------------
--  Records of sys_dept
-- ----------------------------
BEGIN;
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (1, '集团总公司', 'YD', 0, '2018-01-22 19:00:23', '2019-10-25 17:00:27', '0', 0, NULL, 1);
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (2, '东北区域', 'DB', 0, '2019-10-25 17:00:39', '2019-10-25 17:02:41', '0', 1, NULL, 1);
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (3, '河南区域', 'HN', 1, '2019-10-25 17:00:55', '2019-10-25 17:02:43', '0', 1, NULL, 1);
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (4, '江西区域', 'JX', 2, '2019-10-25 17:01:08', '2019-10-25 17:02:45', '0', 1, NULL, 1);
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (5, '内蒙公司', 'NM', 3, '2019-10-25 17:01:58', '2019-10-25 17:02:51', '0', 1, NULL, 1);
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (6, '西北区域', 'XB', 4, '2019-10-25 17:02:19', '2019-10-25 17:02:59', '0', 1, NULL, 1);
INSERT INTO sys_dept(dept_id, name, dept_code, sort, create_time, update_time, del_flag, parent_id, remark, tenant_id) VALUES (7, '西南区域', 'XN', 5, '2019-10-25 17:02:32', '2019-10-25 17:03:08', '0', 1, NULL, 1);
COMMIT;

-- ----------------------------
--  Table structure for sys_dept_relation
-- ----------------------------
DROP TABLE IF EXISTS sys_dept_relation;
CREATE TABLE sys_dept_relation (
  ancestor INTEGER NOT NULL,
  descendant INTEGER NOT NULL,
  PRIMARY KEY (ancestor,descendant)
);
create index idx1 on sys_dept_relation(ancestor);
create index idx2 on sys_dept_relation(descendant);
comment on table sys_dept_relation is '部门关系表';
comment on column sys_dept_relation.ancestor is '祖先节点';
comment on column sys_dept_relation.descendant is '后代节点';

-- ----------------------------
--  Records of sys_dept_relation
-- ----------------------------
BEGIN;
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 1);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 2);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 3);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 4);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 5);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 6);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (1, 7);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (2, 2);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (3, 3);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (4, 4);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (5, 5);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (6, 6);
INSERT INTO sys_dept_relation(ancestor, descendant) VALUES (7, 7);
COMMIT;

-- ----------------------------
--  Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS sys_dict;
CREATE TABLE sys_dict (
  id SERIAL NOT NULL,
  type varchar(100) NOT NULL,
  description varchar(100) NOT NULL,
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  remarks varchar(255) DEFAULT NULL,
  system_flag char(1) DEFAULT '0',
  del_flag char(1) NOT NULL DEFAULT '0',
  tenant_id INTEGER NOT NULL DEFAULT '0',
  PRIMARY KEY (id)
);
create index sys_dict_del_flag on sys_dict(del_flag);
comment on table sys_dict is '字典表';
comment on column sys_dict.id is '编号';
comment on column sys_dict.type is '类型';
comment on column sys_dict.description is '描述';
comment on column sys_dict.create_time is '创建时间';
comment on column sys_dict.update_time is '更新时间';
comment on column sys_dict.remarks is '备注信息';
comment on column sys_dict.del_flag is '删除标记';
comment on column sys_dict.tenant_id is '所属租户';

-- ----------------------------
--  Records of sys_dict
-- ----------------------------
BEGIN;
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (1, 'log_type', '日志类型', '2019-03-19 11:06:44', '2019-03-19 11:06:44', '异常、正常', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (2, 'social_type', '社交登录', '2019-03-19 11:06:44', '2019-03-19 11:06:44', '微信、QQ', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (4, 'job_type', '定时任务类型', '2019-03-19 11:22:21', '2019-03-19 11:22:21', 'quartz', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (5, 'job_status', '定时任务状态', '2019-03-19 11:24:57', '2019-03-19 11:24:57', '发布状态、运行状态', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (6, 'job_execute_status', '定时任务执行状态', '2019-03-19 11:26:15', '2019-03-19 11:26:15', '正常、异常', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (7, 'misfire_policy', '定时任务错失执行策略', '2019-03-19 11:27:19', '2019-03-19 11:27:19', '周期', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (8, 'status_type', '状态', '2019-03-19 11:27:19', '2019-03-19 11:27:19', '状态', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (11, 'param_type', '参数配置', '2019-04-29 18:20:47', '2019-04-29 18:20:47', '检索、原文、报表、安全、文档、消息、其他', '1', '0', 1);
INSERT INTO sys_dict(id, type, description, create_time, update_time, remarks, system_flag, del_flag, tenant_id) VALUES (12, 'dict_type', '字典类型', '2019-10-28 08:45:50', '2019-10-28 09:00:36', '系统类不能修改', '1', '0', 1);
INSERT INTO sys_dict VALUES (31, 'message_type', '消息公告类型', '2020-6-9 17:26:03', '2020-6-9 17:26:03', '通知、公告', '1', '0', 1);
INSERT INTO sys_dict VALUES (32, 'msg_channel', '消息发送方式', '2020-6-9 17:26:03', '2020-6-9 17:26:03', '短信、邮件、站内信', '1', '0', 1);
INSERT INTO sys_dict VALUES (33, 'msg_time_type', '消息发送时间', '2020-6-9 17:26:03', '2020-6-9 17:26:03', '即时、定时', '1', '0', 1);
INSERT INTO sys_dict VALUES (34, 'msg_status', '消息状态', '2020-6-9 17:26:03', '2020-6-9 17:26:03', '已读、未读', '1', '0', 1);
COMMIT;

-- ----------------------------
--  Table structure for sys_dict_item
-- ----------------------------
DROP TABLE IF EXISTS sys_dict_item;
CREATE TABLE sys_dict_item (
  id SERIAL NOT NULL,
  dict_id INTEGER NOT NULL,
  value varchar(100) NOT NULL,
  label varchar(100) NOT NULL,
  type varchar(100) NOT NULL,
  description varchar(100) NOT NULL,
  sort INTEGER NOT NULL DEFAULT '0',
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  remarks varchar(255) DEFAULT NULL,
  del_flag char(1) NOT NULL DEFAULT '0',
  tenant_id INTEGER NOT NULL DEFAULT '0',
  PRIMARY KEY (id)
);
create index sys_dict_value on sys_dict_item(value);
create index sys_dict_label on sys_dict_item(label);
create index sys_dict_item_del_flag on sys_dict_item(del_flag);
comment on table sys_dict_item is '字典项';
comment on column sys_dict_item.id is '编号';
comment on column sys_dict_item.value is '数据值';
comment on column sys_dict_item.label is '标签名';
comment on column sys_dict_item.type is '类型';
comment on column sys_dict_item.description is '描述';
comment on column sys_dict_item.sort is '排序（升序）';
comment on column sys_dict_item.create_time is '创建时间';
comment on column sys_dict_item.update_time is '更新时间';
comment on column sys_dict_item.remarks is '备注信息';
comment on column sys_dict_item.del_flag is '删除标记';
comment on column sys_dict_item.tenant_id is '所属租户';

-- ----------------------------
--  Records of sys_dict_item
-- ----------------------------
BEGIN;
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (1, 1, '9', '异常', 'log_type', '日志异常', 1, '2019-03-19 11:08:59', '2019-03-25 12:49:13', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (2, 1, '0', '正常', 'log_type', '日志正常', 0, '2019-03-19 11:09:17', '2019-03-25 12:49:18', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (3, 2, 'WX', '微信', 'social_type', '微信登录', 0, '2019-03-19 11:09:17', '2019-03-25 12:49:18', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (4, 2, 'QQ', 'QQ', 'social_type', 'QQ登录', 0, '2019-03-19 11:09:17', '2019-03-25 12:49:18', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (9, 4, '1', 'java类', 'job_type', 'java类', 1, '2019-03-19 11:22:37', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (10, 4, '2', 'spring bean', 'job_type', 'spring bean容器实例', 2, '2019-03-19 11:23:05', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (11, 4, '9', '其他', 'job_type', '其他类型', 9, '2019-03-19 11:23:31', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (12, 4, '3', 'Rest 调用', 'job_type', 'Rest 调用', 3, '2019-03-19 11:23:57', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (13, 4, '4', 'jar', 'job_type', 'jar类型', 4, '2019-03-19 11:24:20', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (14, 5, '1', '未发布', 'job_status', '未发布', 1, '2019-03-19 11:25:18', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (15, 5, '2', '运行中', 'job_status', '运行中', 2, '2019-03-19 11:25:31', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (16, 5, '3', '暂停', 'job_status', '暂停', 3, '2019-03-19 11:25:42', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (17, 6, '0', '正常', 'job_execute_status', '正常', 0, '2019-03-19 11:26:27', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (18, 6, '1', '异常', 'job_execute_status', '异常', 1, '2019-03-19 11:26:41', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (19, 7, '1', '错失周期立即执行', 'misfire_policy', '错失周期立即执行', 1, '2019-03-19 11:27:45', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (20, 7, '2', '错失周期执行一次', 'misfire_policy', '错失周期执行一次', 2, '2019-03-19 11:27:57', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (21, 7, '3', '下周期执行', 'misfire_policy', '下周期执行', 3, '2019-03-19 11:28:08', '2019-03-25 12:49:36', '', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (22, 8, '0', '正常', 'status_type', '状态正常', 0, '2019-03-19 11:28:08', '2019-03-25 12:49:36', '状态正常', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (23, 8, '9', '冻结', 'status_type', '状态冻结', 1, '2019-03-19 11:28:08', '2019-03-25 12:49:36', '状态冻结', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (29, 11, '1', '检索', 'param_type', '检索', 0, '2019-04-29 18:22:17', '2019-04-29 18:22:17', '检索', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (30, 11, '2', '原文', 'param_type', '原文', 0, '2019-04-29 18:22:27', '2019-04-29 18:22:27', '原文', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (31, 11, '3', '报表', 'param_type', '报表', 0, '2019-04-29 18:22:36', '2019-04-29 18:22:36', '报表', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (32, 11, '4', '安全', 'param_type', '安全', 0, '2019-04-29 18:22:46', '2019-04-29 18:22:46', '安全', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (33, 11, '5', '文档', 'param_type', '文档', 0, '2019-04-29 18:22:56', '2019-04-29 18:22:56', '文档', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (34, 11, '6', '消息', 'param_type', '消息', 0, '2019-04-29 18:23:05', '2019-04-29 18:23:05', '消息', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (35, 11, '9', '其他', 'param_type', '其他', 0, '2019-04-29 18:23:16', '2019-04-29 18:23:16', '其他', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (36, 11, '0', '默认', 'param_type', '默认', 0, '2019-04-29 18:23:30', '2019-04-29 18:23:30', '默认', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (37, 12, '1', '系统类', 'dict_type', '系统类字典', 0, '2019-04-29 18:23:30', '2019-04-29 18:23:30', '不能修改删除', '0', 1);
INSERT INTO sys_dict_item(id, dict_id, value, label, type, description, sort, create_time, update_time, remarks, del_flag, tenant_id) VALUES (38, 12, '0', '业务类', 'dict_type', '业务类字典', 0, '2019-04-29 18:23:30', '2019-04-29 18:23:30', '可以修改', '0', 1);
INSERT INTO sys_dict_item VALUES (89, 31, '1', '通知', 'message_type', '通知', 1, '2020-7-24 15:57:28', '2020-7-24 15:57:28', '', '0', 1);
INSERT INTO sys_dict_item VALUES (90, 31, '2', '公告', 'message_type', '公告', 2, '2020-7-24 15:57:48', '2020-7-24 15:57:48', '', '0', 1);
INSERT INTO sys_dict_item VALUES (91, 32, '1', '短信', 'msg_channel', '短信', 1, '2020-7-24 15:58:43', '2020-7-24 15:58:43', '', '0', 1);
INSERT INTO sys_dict_item VALUES (92, 32, '2', '邮件', 'msg_channel', '邮件', 2, '2020-7-24 15:58:52', '2020-7-24 15:58:52', '', '0', 1);
INSERT INTO sys_dict_item VALUES (93, 32, '3', '站内信', 'msg_channel', '站内信', 3, '2020-7-24 15:59:06', '2020-7-24 15:59:06', '', '0', 1);
INSERT INTO sys_dict_item VALUES (94, 33, '1', '即时', 'msg_time_type', '即时', 1, '2020-7-24 16:00:03', '2020-7-24 16:00:03', '', '0', 1);
INSERT INTO sys_dict_item VALUES (95, 33, '2', '定时', 'msg_time_type', '定时', 2, '2020-7-24 16:00:10', '2020-7-24 16:00:10', '', '0', 1);
INSERT INTO sys_dict_item VALUES (96, 34, '0', '未读', 'msg_status', '未读', 0, '2020-7-24 16:00:53', '2020-7-24 16:00:53', '', '0', 1);
INSERT INTO sys_dict_item VALUES (97, 34, '1', '已读', 'msg_status', '已读', 1, '2020-7-24 16:01:01', '2020-7-24 16:01:01', '', '0', 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_file
-- ----------------------------
DROP TABLE IF EXISTS sys_file;
CREATE TABLE sys_file (
  id SERIAL NOT NULL,
  file_name varchar(100) DEFAULT NULL,
  bucket_name varchar(200) DEFAULT NULL,
  original varchar(100) DEFAULT NULL,
  type varchar(50) DEFAULT NULL,
  file_size BIGINT DEFAULT NULL,
  create_user varchar(32) DEFAULT NULL,
  create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  update_user varchar(32) DEFAULT NULL,
  update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ,
  del_flag char(1) DEFAULT '0',
  tenant_id INTEGER DEFAULT NULL,
  PRIMARY KEY (id)
);
comment on table sys_file is '文件管理表';
comment on column sys_file.id is '编号';
comment on column sys_file.file_size is '文件大小';
comment on column sys_file.create_time is '上传时间';
comment on column sys_file.update_time is '更新时间';

-- ----------------------------
--  Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS sys_log;
CREATE TABLE sys_log (
  id SERIAL NOT NULL,
  type char(1) DEFAULT '0',
  title varchar(255) DEFAULT '',
  service_id varchar(32) DEFAULT NULL,
  create_by varchar(64) DEFAULT NULL,
  create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  remote_addr varchar(255) DEFAULT NULL,
  user_agent varchar(1000) DEFAULT NULL,
  request_uri varchar(255) DEFAULT NULL,
  method varchar(10) DEFAULT NULL,
  params text,
  time BIGINT,
  del_flag char(1) DEFAULT '0',
  exception text,
  tenant_id INTEGER DEFAULT '0',
  PRIMARY KEY (id)
);
create index sys_log_create_by on sys_log(create_by);
create index sys_log_request_uri on sys_log(request_uri);
create index sys_log_type on sys_log(type);
create index sys_log_create_date on sys_log(create_time);
comment on table sys_log is '日志表';
comment on column sys_log.id is '编号';
comment on column sys_log.type is '日志类型';
comment on column sys_log.title is '日志标题';
comment on column sys_log.service_id is '服务ID';
comment on column sys_log.create_by is '创建者';
comment on column sys_log.create_time is '创建时间';
comment on column sys_log.update_time is '更新时间';
comment on column sys_log.remote_addr is '操作IP地址';
comment on column sys_log.user_agent is '用户代理';
comment on column sys_log.request_uri is '请求URI';
comment on column sys_log.method is '操作方式';
comment on column sys_log.params is '操作提交的数据';
comment on column sys_log.time is '执行时间';
comment on column sys_log.del_flag is '删除标记';
comment on column sys_log.exception is '异常信息';
comment on column sys_log.tenant_id is '所属租户';

-- ----------------------------
--  Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS sys_menu;
CREATE TABLE sys_menu (
  menu_id SERIAL NOT NULL,
  name varchar(32) NOT NULL,
  permission varchar(32) DEFAULT NULL,
  path varchar(128) DEFAULT NULL,
  parent_id INTEGER DEFAULT NULL,
  icon varchar(64) DEFAULT NULL,
  sort INTEGER DEFAULT '1',
  keep_alive char(1) DEFAULT '0',
  type char(1) DEFAULT '0',
  create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  del_flag char(1) DEFAULT '0',
  tenant_id INTEGER DEFAULT NULL,
  PRIMARY KEY (menu_id)
);
comment on table sys_menu is '菜单权限表';
comment on column sys_menu.menu_id is '菜单ID';
comment on column sys_menu.name is '菜单名称';
comment on column sys_menu.permission is '菜单权限标识';
comment on column sys_menu.path is '前端URL';
comment on column sys_menu.parent_id is '父菜单ID';
comment on column sys_menu.icon is '图标';
comment on column sys_menu.sort is '排序值';
comment on column sys_menu.keep_alive is '0-开启，1- 关闭';
comment on column sys_menu.type is '菜单类型 （0菜单 1按钮）';
comment on column sys_menu.create_time is '创建时间';
comment on column sys_menu.update_time is '更新时间';
comment on column sys_menu.del_flag is '逻辑删除标记(0--正常 1--删除)';
comment on column sys_menu.tenant_id is '租户ID';
-- ----------------------------
--  Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO sys_menu VALUES (1000, '系统管理', '', '/admin', -1, 'fa fa-gear', 7, '0', '0', '2018-9-28 08:29:53', '2020-5-5 00:39:46', '0', 1);
INSERT INTO sys_menu VALUES (1100, '用户管理', '', '/admin/user/index', 1000, '', 1, '1', '0', '2017-11-2 22:24:37', '2020-5-5 00:25:22', '0', 1);
INSERT INTO sys_menu VALUES (1101, '用户新增', 'sys_user_add', NULL, 1100, NULL, NULL, '0', '1', '2017-11-8 09:52:09', '2018-9-28 09:06:34', '0', 1);
INSERT INTO sys_menu VALUES (1102, '用户修改', 'sys_user_edit', NULL, 1100, NULL, NULL, '0', '1', '2017-11-8 09:52:48', '2018-9-28 09:06:37', '0', 1);
INSERT INTO sys_menu VALUES (1103, '用户删除', 'sys_user_del', NULL, 1100, NULL, NULL, '0', '1', '2017-11-8 09:54:01', '2018-9-28 09:06:42', '0', 1);
INSERT INTO sys_menu VALUES (1200, '菜单管理', '', '/admin/menu/index', 1000, '', 2, '0', '0', '2017-11-8 09:57:27', '2020-5-5 00:25:35', '0', 1);
INSERT INTO sys_menu VALUES (1201, '菜单新增', 'sys_menu_add', NULL, 1200, NULL, NULL, '0', '1', '2017-11-8 10:15:53', '2018-9-28 09:07:16', '0', 1);
INSERT INTO sys_menu VALUES (1202, '菜单修改', 'sys_menu_edit', NULL, 1200, NULL, NULL, '0', '1', '2017-11-8 10:16:23', '2018-9-28 09:07:18', '0', 1);
INSERT INTO sys_menu VALUES (1203, '菜单删除', 'sys_menu_del', NULL, 1200, NULL, NULL, '0', '1', '2017-11-8 10:16:43', '2018-9-28 09:07:22', '0', 1);
INSERT INTO sys_menu VALUES (1300, '角色管理', '', '/admin/role/index', 1000, '', 3, '0', '0', '2017-11-8 10:13:37', '2020-5-5 00:25:56', '0', 1);
INSERT INTO sys_menu VALUES (1301, '角色新增', 'sys_role_add', NULL, 1300, NULL, NULL, '0', '1', '2017-11-8 10:14:18', '2018-9-28 09:07:46', '0', 1);
INSERT INTO sys_menu VALUES (1302, '角色修改', 'sys_role_edit', NULL, 1300, NULL, NULL, '0', '1', '2017-11-8 10:14:41', '2018-9-28 09:07:49', '0', 1);
INSERT INTO sys_menu VALUES (1303, '角色删除', 'sys_role_del', NULL, 1300, NULL, NULL, '0', '1', '2017-11-8 10:14:59', '2020-4-18 23:18:16', '0', 1);
INSERT INTO sys_menu VALUES (1304, '分配权限', 'sys_role_perm', NULL, 1300, NULL, NULL, '0', '1', '2018-4-20 07:22:55', '2018-9-28 09:13:23', '0', 1);
INSERT INTO sys_menu VALUES (1400, '部门管理', '', '/admin/dept/index', 1000, '', 4, '0', '0', '2018-1-20 13:17:19', '2020-5-5 00:26:04', '0', 1);
INSERT INTO sys_menu VALUES (1401, '部门新增', 'sys_dept_add', NULL, 1400, NULL, NULL, '0', '1', '2018-1-20 14:56:16', '2018-9-28 09:08:13', '0', 1);
INSERT INTO sys_menu VALUES (1402, '部门修改', 'sys_dept_edit', NULL, 1400, NULL, NULL, '0', '1', '2018-1-20 14:56:59', '2018-9-28 09:08:16', '0', 1);
INSERT INTO sys_menu VALUES (1403, '部门删除', 'sys_dept_del', NULL, 1400, NULL, NULL, '0', '1', '2018-1-20 14:57:28', '2018-9-28 09:08:18', '0', 1);
INSERT INTO sys_menu VALUES (1500, '字典管理', '', '/admin/dict/index', 1000, '', 5, '0', '0', '2018-1-20 13:17:19', '2020-5-5 14:13:17', '0', 1);
INSERT INTO sys_menu VALUES (1501, '字典新增', 'sys_dict_add', '', 1500, '1', 0, '0', '1', '2018-5-15 21:35:18', '2020-5-5 00:27:10', '0', 1);
INSERT INTO sys_menu VALUES (1502, '字典修改', 'sys_dict_edit', '', 1500, '1', 1, '0', '1', '2018-5-15 21:35:18', '2020-5-5 00:27:27', '0', 1);
INSERT INTO sys_menu VALUES (1503, '字典删除', 'sys_dict_del', '', 1500, '1', 2, '0', '1', '2018-5-15 21:35:18', '2020-5-5 00:27:55', '0', 1);
INSERT INTO sys_menu VALUES (2100, '日志管理', '', '/admin/log/index', 1000, '', 6, '0', '0', '2017-11-20 14:06:22', '2020-5-5 01:07:10', '0', 1);
INSERT INTO sys_menu VALUES (2101, '日志删除', 'sys_log_del', NULL, 2100, NULL, NULL, '0', '1', '2017-11-20 20:37:37', '2018-9-28 09:08:44', '0', 1);
INSERT INTO sys_menu VALUES (2210, '参数管理', '', '/admin/param/index', 1000, '', 7, '1', '0', '2019-4-29 22:16:50', '2020-5-5 01:07:20', '0', 1);
INSERT INTO sys_menu VALUES (2211, '参数新增', 'admin_syspublicparam_add', NULL, 2210, NULL, 1, '0', '1', '2019-4-29 22:17:36', NULL, '0', 1);
INSERT INTO sys_menu VALUES (2212, '参数删除', 'admin_syspublicparam_del', NULL, 2210, NULL, 1, '0', '1', '2019-4-29 22:17:55', NULL, '0', 1);
INSERT INTO sys_menu VALUES (2213, '参数编辑', 'admin_syspublicparam_edit', NULL, 2210, NULL, 1, '0', '1', '2019-4-29 22:18:14', '2019-4-29 22:19:25', '0', 1);
INSERT INTO sys_menu VALUES (2300, '代码生成', '', '/tool/gen', 10006, '', 1, '0', '0', '2018-1-20 13:17:19', '2020-5-5 01:17:34', '0', 1);
INSERT INTO sys_menu VALUES (2800, 'Quartz管理', '', '/admin/job/index', 1000, '', 8, '0', '0', '2018-1-20 13:17:19', '2020-5-7 16:27:40', '0', 1);
INSERT INTO sys_menu VALUES (2810, '任务新增', 'job_sys_job_add', NULL, 2800, '1', 0, '0', '1', '2018-5-15 21:35:18', '2019-3-25 11:50:23', '0', 1);
INSERT INTO sys_menu VALUES (2820, '任务修改', 'job_sys_job_edit', NULL, 2800, '1', 0, '0', '1', '2018-5-15 21:35:18', '2019-3-25 11:50:26', '0', 1);
INSERT INTO sys_menu VALUES (2830, '任务删除', 'job_sys_job_del', NULL, 2800, '1', 0, '0', '1', '2018-5-15 21:35:18', '2019-3-25 11:50:30', '0', 1);
INSERT INTO sys_menu VALUES (2840, '任务暂停', 'job_sys_job_shutdown_job', NULL, 2800, '1', 0, '0', '1', '2018-5-15 21:35:18', '2019-3-25 11:50:18', '0', 1);
INSERT INTO sys_menu VALUES (2850, '任务启动', 'job_sys_job_start_job', NULL, 2800, '1', 0, '0', '1', '2018-5-15 21:35:18', '2020-5-7 20:21:42', '0', 1);
INSERT INTO sys_menu VALUES (2860, '任务重置', 'job_sys_job_refresh_job', NULL, 2800, '1', 0, '0', '1', '2018-5-15 21:35:18', '2020-5-7 20:12:25', '0', 1);
INSERT INTO sys_menu VALUES (2870, '执行任务', 'job_sys_job_run_job', NULL, 2800, '1', 0, '0', '1', '2019-8-8 15:35:18', '2019-8-8 15:50:35', '0', 1);
INSERT INTO sys_menu VALUES (3000, '系统监控', '', '/daemon', -1, 'fa fa-video-camera', 8, '0', '0', '2018-7-27 01:13:21', '2020-5-5 00:40:38', '0', 1);
INSERT INTO sys_menu VALUES (3110, '数据监控', '', '/monitor/data', 3000, '', 1, '1', '0', '2019-5-8 23:51:27', '2020-5-5 01:08:08', '0', 1);
INSERT INTO sys_menu VALUES (3620, '服务监控', '', '/monitor/server', 3000, '', 2, '0', '0', '2018-1-20 13:17:19', '2020-5-5 01:08:38', '0', 1);
INSERT INTO sys_menu VALUES (3621, '缓存监控', '', '/monitor/cache', 3000, '', 3, '0', '0', '2018-1-20 13:17:19', '2020-5-5 01:08:38', '0', 1);
INSERT INTO sys_menu VALUES (10000, '文件管理', '', '/admin/file/index', 1000, '', 9, '1', '0', '2019-6-25 12:44:46', '2020-5-5 00:39:21', '0', 1);
INSERT INTO sys_menu VALUES (10001, '删除文件', 'sys_file_del', NULL, 10000, NULL, 1, '0', '1', '2019-6-25 13:41:41', NULL, '0', 1);
INSERT INTO sys_menu VALUES (10002, '表单构建', '', '/tool/build', 10006, '', 2, '0', '0', '2018-1-20 13:17:19', '2020-5-5 01:17:43', '0', 1);
INSERT INTO sys_menu VALUES (10006, '系统开发', '', '/gen', -1, 'fa fa-bars', 9, '1', '0', '2019-8-12 09:35:16', '2020-5-5 00:41:13', '0', 1);
INSERT INTO sys_menu VALUES (10011, '接口文档', '', '/tool/swagger', 10006, '', 3, '0', '0', '2020-1-4 19:30:35', '2020-5-5 01:18:14', '0', 1);
INSERT INTO sys_menu VALUES (10012, '消息发送', NULL, '/message', -1, 'fa fa-bell', 10, '0', '0', '2020-5-25 17:24:36', '2020-6-3 15:07:05', '0', 1);
INSERT INTO sys_menu VALUES (10013, '消息管理', NULL, '/msg/messages/index', 10012, 'icon-gongzhonghao', 1, '0', '0', '2020-5-25 17:24:36', '2020-6-3 15:07:05', '0', 1);
INSERT INTO sys_menu VALUES (10014, '新增', 'msg_add', NULL, 10013, NULL, 1, '0', '1', '2020-5-25 17:26:02', NULL, '0', 1);
INSERT INTO sys_menu VALUES (10015, '编辑', 'msg_edit', NULL, 10013, NULL, 2, '0', '1', '2020-5-25 17:26:24', NULL, '0', 1);
INSERT INTO sys_menu VALUES (10016, '删除', 'msg_del', NULL, 10013, NULL, 3, '0', '1', '2020-5-25 17:26:48', NULL, '0', 1);
INSERT INTO sys_menu VALUES (10018, '组件示例', '', '/tool/example', 10006, '', 4, '0', '0', '2021-01-08 10:02:50', '2021-01-08 10:17:20', '0', 1);
INSERT INTO sys_menu VALUES (1600, '租户管理', '', '/admin/tenant/index', 1000, '', 10, '0', '0', '2018-1-20 13:17:19', '2020-5-16 01:51:07', '0', 1);
INSERT INTO sys_menu VALUES (1601, '租户新增', 'admin_systenant_add', NULL, 1600, '1', 0, '0', '1', '2018-5-15 21:35:18', '2020-5-16 01:51:07', '0', 1);
INSERT INTO sys_menu VALUES (1602, '租户修改', 'admin_systenant_edit', NULL, 1600, '1', 1, '0', '1', '2018-5-15 21:35:18', '2020-5-16 01:51:07', '0', 1);
INSERT INTO sys_menu VALUES (1603, '租户删除', 'admin_systenant_del', NULL, 1600, '1', 2, '0', '1', '2018-5-15 21:35:18', '2020-5-16 01:51:07', '0', 1);
COMMIT;

-- ----------------------------
--  Table structure for sys_public_param
-- ----------------------------
DROP TABLE IF EXISTS sys_public_param;
CREATE TABLE sys_public_param (
  public_id SERIAL NOT NULL,
  public_name varchar(128) NOT NULL,
  public_key varchar(128) NOT NULL,
  public_value varchar(128) DEFAULT NULL,
  status char(1) DEFAULT '1',
  validate_code varchar(64) DEFAULT NULL,
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  public_type char(1) DEFAULT '0',
  system_flag char(1) DEFAULT '0',
  del_flag char(1) DEFAULT '0',
  tenant_id INTEGER DEFAULT '0',
  PRIMARY KEY (public_id)
);
comment on table sys_public_param is '公共参数配置表';
comment on column sys_public_param.public_id is '编号';
comment on column sys_public_param.public_name is '公共参数名称';
comment on column sys_public_param.public_key is '键,英文大写+下划线';
comment on column sys_public_param.public_value is '值';
comment on column sys_public_param.status is '状态：0有效；9无效；';
comment on column sys_public_param.validate_code is '公共参数编码';
comment on column sys_public_param.create_time is '创建时间';
comment on column sys_public_param.update_time is '修改时间';
comment on column sys_public_param.public_type is '配置类型：0-默认；1-检索；2-原文；3-报表；4-安全；5-文档；6-消息；9-其他';
comment on column sys_public_param.del_flag is '删除状态：0-正常；1-已删除';
comment on column sys_public_param.tenant_id is '租户ID';

-- ----------------------------
-- Records of sys_public_param
-- ----------------------------
BEGIN;
INSERT INTO sys_public_param VALUES (1, '租户默认来源', 'TENANT_DEFAULT_ID', '1', '0', '', '2020-05-12 04:03:46', NULL, '2', '1', '0', 1);
INSERT INTO sys_public_param VALUES (2, '租户默认部门名称', 'TENANT_DEFAULT_DEPTNAME', '租户默认部门', '0', '', '2020-05-12 03:36:32', NULL, '2', '1', '0', 1);
INSERT INTO sys_public_param VALUES (3, '租户默认账户', 'TENANT_DEFAULT_USERNAME', 'admin', '0', '', '2020-05-12 04:05:04', NULL, '2', '1', '0', 1);
INSERT INTO sys_public_param VALUES (4, '租户默认密码', 'TENANT_DEFAULT_PASSWORD', '123456', '0', '', '2020-05-12 04:05:24', NULL, '2', '1', '0', 1);
INSERT INTO sys_public_param VALUES (5, '租户默认角色编码', 'TENANT_DEFAULT_ROLECODE', 'ROLE_ADMIN', '0', '', '2020-05-12 04:05:57', NULL, '2', '1', '0', 1);
INSERT INTO sys_public_param VALUES (6, '租户默认角色名称', 'TENANT_DEFAULT_ROLENAME', '租户默认角色', '0', '', '2020-05-12 04:06:19', NULL, '2', '1', '0', 1);
COMMIT;

-- ----------------------------
--  Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS sys_role;
CREATE TABLE sys_role (
  role_id SERIAL NOT NULL,
  role_name varchar(64) NOT NULL,
  role_code varchar(64) NOT NULL,
  role_desc varchar(255)DEFAULT NULL,
  ds_type char(1) NOT NULL DEFAULT '2',
  ds_scope varchar(255) DEFAULT NULL,
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  del_flag char(1) DEFAULT '0',
  tenant_id INTEGER DEFAULT NULL,
  PRIMARY KEY (role_id)
);
comment on table sys_role is '系统角色表';
comment on column sys_role.ds_type is '数据权限类型';
comment on column sys_role.ds_scope is '数据权限范围';
comment on column sys_role.del_flag is '删除标识（0-正常,1-删除）';

-- ----------------------------
--  Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO sys_role VALUES ('1', '管理员', 'ROLE_ADMIN', '管理员', '0', '2', '2017-10-29 15:45:51', '2018-12-26 14:09:11', '0', '1');
COMMIT;

-- ----------------------------
--  Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS sys_role_menu;
CREATE TABLE sys_role_menu (
  role_id INTEGER NOT NULL,
  menu_id INTEGER NOT NULL,
  PRIMARY KEY (role_id,menu_id)
);
comment on table sys_role_menu is '角色菜单表';
comment on column sys_role_menu.role_id is '角色ID';
comment on column sys_role_menu.menu_id is '菜单ID';

-- ----------------------------
--  Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO sys_role_menu VALUES (1, 1000);
INSERT INTO sys_role_menu VALUES (1, 1100);
INSERT INTO sys_role_menu VALUES (1, 1101);
INSERT INTO sys_role_menu VALUES (1, 1102);
INSERT INTO sys_role_menu VALUES (1, 1103);
INSERT INTO sys_role_menu VALUES (1, 1200);
INSERT INTO sys_role_menu VALUES (1, 1201);
INSERT INTO sys_role_menu VALUES (1, 1202);
INSERT INTO sys_role_menu VALUES (1, 1203);
INSERT INTO sys_role_menu VALUES (1, 1300);
INSERT INTO sys_role_menu VALUES (1, 1301);
INSERT INTO sys_role_menu VALUES (1, 1302);
INSERT INTO sys_role_menu VALUES (1, 1303);
INSERT INTO sys_role_menu VALUES (1, 1304);
INSERT INTO sys_role_menu VALUES (1, 1400);
INSERT INTO sys_role_menu VALUES (1, 1401);
INSERT INTO sys_role_menu VALUES (1, 1402);
INSERT INTO sys_role_menu VALUES (1, 1403);
INSERT INTO sys_role_menu VALUES (1, 1500);
INSERT INTO sys_role_menu VALUES (1, 1501);
INSERT INTO sys_role_menu VALUES (1, 1502);
INSERT INTO sys_role_menu VALUES (1, 1503);
INSERT INTO sys_role_menu VALUES (1, 2100);
INSERT INTO sys_role_menu VALUES (1, 2101);
INSERT INTO sys_role_menu VALUES (1, 2210);
INSERT INTO sys_role_menu VALUES (1, 2211);
INSERT INTO sys_role_menu VALUES (1, 2212);
INSERT INTO sys_role_menu VALUES (1, 2213);
INSERT INTO sys_role_menu VALUES (1, 2300);
INSERT INTO sys_role_menu VALUES (1, 2800);
INSERT INTO sys_role_menu VALUES (1, 2810);
INSERT INTO sys_role_menu VALUES (1, 2820);
INSERT INTO sys_role_menu VALUES (1, 2830);
INSERT INTO sys_role_menu VALUES (1, 2840);
INSERT INTO sys_role_menu VALUES (1, 2850);
INSERT INTO sys_role_menu VALUES (1, 2860);
INSERT INTO sys_role_menu VALUES (1, 2870);
INSERT INTO sys_role_menu VALUES (1, 3000);
INSERT INTO sys_role_menu VALUES (1, 3110);
INSERT INTO sys_role_menu VALUES (1, 3620);
INSERT INTO sys_role_menu VALUES (1, 3621);
INSERT INTO sys_role_menu VALUES (1, 10000);
INSERT INTO sys_role_menu VALUES (1, 10001);
INSERT INTO sys_role_menu VALUES (1, 10002);
INSERT INTO sys_role_menu VALUES (1, 10006);
INSERT INTO sys_role_menu VALUES (1, 10011);
INSERT INTO sys_role_menu VALUES (1, 10018);
INSERT INTO sys_role_menu VALUES (1, 1600);
INSERT INTO sys_role_menu VALUES (1, 1601);
INSERT INTO sys_role_menu VALUES (1, 1602);
INSERT INTO sys_role_menu VALUES (1, 1603);
INSERT INTO sys_role_menu VALUES (1, 3621);
COMMIT;
-- ----------------------------
-- Table structure for sys_tenant
-- ----------------------------
DROP TABLE IF EXISTS sys_tenant;
CREATE TABLE sys_tenant (
  id SERIAL NOT NULL,
  name varchar(255) DEFAULT NULL,
  code varchar(64) DEFAULT NULL,
  start_time date NULL DEFAULT NULL,
  end_time date NULL DEFAULT NULL,
  status CHARACTER(1) DEFAULT '0',
  del_flag CHARACTER(1) DEFAULT '0',
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (id)
);
comment on table sys_tenant is '租户表';
comment on column sys_tenant.id is '租户id';
comment on column sys_tenant.start_time is '开始时间';
comment on column sys_tenant.end_time is '结束时间';
comment on column sys_tenant.create_time is '创建时间';
comment on column sys_tenant.update_time is '更新时间';

-- ----------------------------
-- Records of sys_tenant
-- ----------------------------
BEGIN;
INSERT INTO sys_tenant VALUES (1, '北京分公司', '1', '2019-05-15 00:00:00', '2029-05-15 00:00:00', '0', '0', '2019-05-15 15:44:57', '2019-05-18 14:47:30');
COMMIT;

-- ----------------------------
--  Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS sys_user;
CREATE TABLE sys_user (
  user_id SERIAL NOT NULL,
  loginname varchar(64) NOT NULL,
  username varchar(64) NOT NULL,
  password varchar(255) NOT NULL,
  salt varchar(255) DEFAULT NULL,
  phone varchar(20) DEFAULT NULL,
  email varchar(150) DEFAULT NULL,
  avatar varchar(255) DEFAULT NULL,
  dept_id INTEGER DEFAULT NULL,
  remark varchar(255) DEFAULT NULL,
  create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  lock_flag char(1) DEFAULT '0',
  del_flag char(1) DEFAULT '0',
  wx_openid varchar(32) DEFAULT NULL,
  mini_openid varchar(32) DEFAULT NULL,
  qq_openid varchar(32) DEFAULT NULL,
  gitee_login varchar(100) DEFAULT NULL,
  osc_id varchar(100) DEFAULT NULL,
  tenant_id INTEGER NOT NULL DEFAULT '0',
  PRIMARY KEY (user_id)
);
create index user_wx_openid on sys_user(wx_openid);
create index user_qq_openid on sys_user(qq_openid);
create index user_idx1_loginname on sys_user(loginname);
create index user_idx2_phone on sys_user(phone);
comment on table sys_user is '用户表';
comment on column sys_user.user_id is '主键ID';
comment on column sys_user.loginname is '登录名';
comment on column sys_user.username is '用户名';
comment on column sys_user.salt is '随机盐';
comment on column sys_user.phone is '手机';
comment on column sys_user.email is '邮箱';
comment on column sys_user.avatar is '头像';
comment on column sys_user.dept_id is '部门ID';
comment on column sys_user.remark is '说明';
comment on column sys_user.create_time is '创建时间';
comment on column sys_user.update_time is '修改时间';
comment on column sys_user.lock_flag is '0-正常，9-锁定';
comment on column sys_user.del_flag is '0-正常，1-删除';
comment on column sys_user.wx_openid is '微信openid';
comment on column sys_user.mini_openid is '小程序openId';
comment on column sys_user.qq_openid is 'QQ openid';
comment on column sys_user.gitee_login is '码云标识';
comment on column sys_user.osc_id is '开源中国标识';
comment on column sys_user.tenant_id is '所属租户';

-- ----------------------------
--  Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO sys_user VALUES ('1', 'admin', '管理员','$2a$10$MWa9awUairBJY09AehOdP.zfoAXWRa4Tdja1TFBvYmEub0vbHeuFm', '', '17034642889', '', '', '1', '', '2018-04-20 07:15:18', '2019-04-30 12:37:44', '0', '0', 'o_0FT0uyg_H1vVy2H0JpSwlVGhWQ', null, null, null, null, '1');
COMMIT;

-- ----------------------------
--  Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS sys_user_role;
CREATE TABLE sys_user_role (
  user_id INTEGER NOT NULL,
  role_id INTEGER NOT NULL,
  PRIMARY KEY (user_id,role_id)
);
comment on table sys_user_role is '用户角色表';
comment on column sys_user_role.user_id is '用户ID';
comment on column sys_user_role.role_id is '角色ID';

-- ----------------------------
--  Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO sys_user_role VALUES ('1', '1');
COMMIT;

-- ----------------------------
--   Table structure for sys_welcome
--  首页用户配置快捷菜单表
-- ----------------------------
DROP TABLE IF EXISTS sys_welcome;
CREATE TABLE sys_welcome (
  wel_id SERIAL,
  user_id INTEGER NOT NULL,
  icon varchar(32) DEFAULT '',
  path varchar(128) NOT NULL DEFAULT '',
  label varchar(128) NOT NULL DEFAULT '',
  sort INTEGER NOT NULL,
  PRIMARY KEY (wel_id)
);
comment on table sys_welcome is '快速导航';
comment on column sys_welcome.wel_id is '主页便捷菜单id';
comment on column sys_welcome.user_id is '用户id';
comment on column sys_welcome.icon is '菜单icon';
comment on column sys_welcome.path is '路径';
comment on column sys_welcome.label is '菜单名称';
comment on column sys_welcome.sort is '排序号';

-- ----------------------------
-- Table structure for sys_messages
-- ----------------------------
DROP TABLE IF EXISTS sys_messages;
CREATE TABLE sys_messages (
  MSG_ID SERIAL NOT NULL,
  MSG_TYPE char(1) DEFAULT NULL,
  MSG_TITLE varchar(125) DEFAULT NULL,
  MSG_CONTENT text,
  MSG_STATUS char(1) DEFAULT NULL,
  SEND_CHANNEL varchar(10) DEFAULT NULL,
  SEND_TYPE char(1) DEFAULT NULL,
  SEND_RULE varchar(100) DEFAULT NULL,
  RECEIVE_RANGE char(1) DEFAULT NULL,
  DEL_FLAG char(1) DEFAULT '0',
  CREATE_BY INTEGER DEFAULT NULL,
  CREATE_TIME timestamp NULL DEFAULT NULL,
  UPDATE_BY INTEGER DEFAULT NULL,
  UPDATE_TIME timestamp NULL DEFAULT NULL,
  PRIMARY KEY (MSG_ID)
);
comment on table sys_messages is '消息基础表';
comment on column sys_messages.MSG_ID is '主键';
comment on column sys_messages.MSG_TYPE is '消息类型，数据字典项《msg_type》';
comment on column sys_messages.MSG_TITLE is '消息标题';
comment on column sys_messages.MSG_CONTENT is '消息内容(支持HTML格式保存)';
comment on column sys_messages.MSG_STATUS is '状态(0:新建,1:发送)';
comment on column sys_messages.SEND_CHANNEL is '发送渠道，数据字典《msg_channel》';
comment on column sys_messages.SEND_TYPE is '发送方式，1实时，2定时';
comment on column sys_messages.SEND_RULE is '定时发送规则，cron表达式';
comment on column sys_messages.RECEIVE_RANGE is '接收人范围(1:表示部分,2表示全部)';
comment on column sys_messages.DEL_FLAG is '0-正常，1-删除';
comment on column sys_messages.CREATE_BY is '创建人ID';
comment on column sys_messages.CREATE_TIME is '创建时间';
comment on column sys_messages.UPDATE_BY is '更新人ID';
comment on column sys_messages.UPDATE_TIME is '更新时间';

-- ----------------------------
-- Table structure for sys_msg_receiver
-- ----------------------------
DROP TABLE IF EXISTS sys_msg_receiver;
CREATE TABLE sys_msg_receiver (
  MSG_ID INTEGER NOT NULL,
  RECEIVER_USER_ID INTEGER NOT NULL,
  RECEIVER_READ_STATUS char(1) DEFAULT '0',
  RECEIVER_TYPE char(1) NOT NULL,
  PRIMARY KEY (MSG_ID,RECEIVER_USER_ID,RECEIVER_TYPE)
);
comment on table sys_msg_receiver is '消息接收人';
comment on column sys_msg_receiver.MSG_ID is '消息ID';
comment on column sys_msg_receiver.RECEIVER_USER_ID is '接收人ID';
comment on column sys_msg_receiver.RECEIVER_READ_STATUS is '已读未读(0:未读,1:已读)';
comment on column sys_msg_receiver.RECEIVER_TYPE is '所属类别(0:发送个人,1表示发送部门,2表示发送角色,3表示全部)';

-- ----------------------------
-- Table structure for sys_msg_result
-- ----------------------------
DROP TABLE IF EXISTS sys_msg_result;
CREATE TABLE sys_msg_result (
  RESULT_ID SERIAL NOT NULL,
  MSG_ID INTEGER NOT NULL,
  RECEIVER_USER_ID INTEGER DEFAULT NULL,
  RESULT_CODE char(1) DEFAULT NULL,
  RESULT_MSG text,
  MSG_CHANNEL char(1) DEFAULT NULL,
  DEL_FLAG char(1) DEFAULT '0',
  CREATE_BY INTEGER DEFAULT NULL,
  CREATE_TIME timestamp NULL DEFAULT NULL,
  UPDATE_BY INTEGER DEFAULT NULL,
  UPDATE_TIME timestamp NULL DEFAULT NULL,
  PRIMARY KEY (RESULT_ID)
);
comment on table sys_msg_result is '消息发送结果表';
comment on column sys_msg_result.RESULT_ID is '主键';
comment on column sys_msg_result.MSG_ID is '消息ID';
comment on column sys_msg_result.RECEIVER_USER_ID is '消息接收人';
comment on column sys_msg_result.RESULT_CODE is '消息发送结果编码，0成功，1失败';
comment on column sys_msg_result.RESULT_MSG is '消息发送结果信息';
comment on column sys_msg_result.MSG_CHANNEL is '消息发送渠道';
comment on column sys_msg_result.DEL_FLAG is '删除标识（0-正常,1-删除）';
comment on column sys_msg_result.CREATE_BY is '创建人ID';
comment on column sys_msg_result.CREATE_TIME is '创建时间';
comment on column sys_msg_result.UPDATE_BY is '更新人ID';
comment on column sys_msg_result.UPDATE_TIME is '更新时间';

-- ----------------------------
-- Table structure for sys_msg_dept
-- ----------------------------
DROP TABLE IF EXISTS sys_msg_dept;
CREATE TABLE sys_msg_dept (
  MSG_DEPT_ID SERIAL NOT NULL,
  MSG_ID INTEGER DEFAULT NULL,
  DEPT_ID INTEGER DEFAULT NULL,
  PRIMARY KEY (MSG_DEPT_ID)
);
comment on table sys_msg_dept is '消息接收部门表';
comment on column sys_msg_dept.MSG_DEPT_ID is '主键';
comment on column sys_msg_dept.MSG_ID is '消息主键';
comment on column sys_msg_dept.DEPT_ID is '部门主键';

-- ----------------------------
-- Table structure for sys_msg_role
-- ----------------------------
DROP TABLE IF EXISTS sys_msg_role;
CREATE TABLE sys_msg_role (
  MSG_ROLE_ID SERIAL NOT NULL,
  MSG_ID INTEGER DEFAULT NULL,
  ROLE_ID INTEGER DEFAULT NULL,
  PRIMARY KEY (MSG_ROLE_ID)
);
comment on table sys_msg_role is '消息接收角色表';
comment on column sys_msg_role.MSG_ROLE_ID is '主键';
comment on column sys_msg_role.MSG_ID is '消息主键';
comment on column sys_msg_role.ROLE_ID is '角色主键';

-- ----------------------------
-- 19、代码生成业务表
-- ----------------------------
drop table if exists gen_table;
create table gen_table (
  table_id          SERIAL     		not null,
  table_name        varchar(200)    default '',
  table_comment     varchar(500)    default '',
  class_name        varchar(100)    default '',
  tpl_category      varchar(200)    default 'crud',
  package_name      varchar(100),
  module_name       varchar(30),
  business_name     varchar(30),
  function_name     varchar(50),
  function_author   varchar(50),
  options           varchar(1000),
  create_by         varchar(64)     default '',
  create_time 	    TIMESTAMP,
  update_by         varchar(64)     default '',
  update_time       TIMESTAMP,
  remark            varchar(500)    default null,
  primary key (table_id)
);
comment on table gen_table is '代码生成业务表';
comment on column gen_table.table_id is '编号';
comment on column gen_table.table_name is '表名称';
comment on column gen_table.table_comment is '表描述';
comment on column gen_table.class_name is '实体类名称';
comment on column gen_table.tpl_category is '使用的模板（crud单表操作 tree树表操作）';
comment on column gen_table.package_name is '生成包路径';
comment on column gen_table.module_name is '生成模块名';
comment on column gen_table.business_name is '生成业务名';
comment on column gen_table.function_name is '生成功能名';
comment on column gen_table.function_author is '生成功能作者';
comment on column gen_table.options is '其它生成选项';
comment on column gen_table.create_by is '创建者';
comment on column gen_table.create_time is '创建时间';
comment on column gen_table.update_by is '更新者';
comment on column gen_table.update_time is '更新时间';
comment on column gen_table.remark is '备注';

-- ----------------------------
-- 20、代码生成业务表字段
-- ----------------------------
drop table if exists gen_table_column;
create table gen_table_column (
  column_id         SERIAL      not null,
  table_id          varchar(64),
  column_name       varchar(200),
  column_comment    varchar(500),
  column_type       varchar(100),
  java_type         varchar(500),
  java_field        varchar(200),
  is_pk             char(1),
  is_increment      char(1),
  is_required       char(1),
  is_insert         char(1),
  is_edit           char(1),
  is_list           char(1),
  is_query          char(1),
  query_type        varchar(200)    default 'EQ',
  html_type         varchar(200),
  dict_type         varchar(200)    default '',
  sort              INTEGER,
  create_by         varchar(64)     default '',
  create_time 	    TIMESTAMP,
  update_by         varchar(64)     default '',
  update_time       TIMESTAMP,
  primary key (column_id)
);
comment on table gen_table_column is '代码生成业务表字段';
comment on column gen_table_column.column_id is '编号';
comment on column gen_table_column.table_id is '归属表编号';
comment on column gen_table_column.column_name is '列名称';
comment on column gen_table_column.column_comment is '列描述';
comment on column gen_table_column.column_type is '列类型';
comment on column gen_table_column.java_type is 'JAVA类型';
comment on column gen_table_column.java_field is 'JAVA字段名';
comment on column gen_table_column.is_pk is '是否主键（1是）';
comment on column gen_table_column.is_increment is '是否自增（1是）';
comment on column gen_table_column.is_required is '是否必填（1是）';
comment on column gen_table_column.is_insert is '是否为插入字段（1是）';
comment on column gen_table_column.is_edit is '是否编辑字段（1是）';
comment on column gen_table_column.is_list is '是否列表字段（1是）';
comment on column gen_table_column.is_query is '是否查询字段（1是）';
comment on column gen_table_column.query_type is '查询方式（等于、不等于、大于、小于、范围）';
comment on column gen_table_column.html_type is '显示类型（文本框、文本域、下拉框、复选框、单选框、日期控件）';
comment on column gen_table_column.dict_type is '字典类型';
comment on column gen_table_column.sort is '排序';
comment on column gen_table_column.create_by is '创建者';
comment on column gen_table_column.create_time is '创建时间';
comment on column gen_table_column.update_by is '更新者';
comment on column gen_table_column.update_time is '更新时间';

-- ----------------------------
--  Table structure for sys_idepermission
--  IDE权限设置专用表
-- ----------------------------
drop table if exists sys_idepermission;
create table sys_idepermission (
   id SERIAL not NULL,
   perm_name varchar(60) not null,
   perm_code varchar(60) not null,
   primary key (id)
);
comment on table sys_idepermission is 'IDE权限表';
comment on column sys_idepermission.id is 'PK';
comment on column sys_idepermission.perm_name is '权限名称';
comment on column sys_idepermission.perm_code is '权限代码';

BEGIN;
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_业务组件', 'bc_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_技术组件', 'tc_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_项目', 'project_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_银行', 'bank_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_java文件', 'java_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_技术模板', 'ct_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_业务组件', 'bc_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_报文', 'msg_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_交易', 'serviceFolder_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_技术组件', 'tc_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_模板', 'template_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_技术组件', 'tc_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_模板', 'template_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_技术组件清单文档', 'tcptDetail_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_数据字典', 'dd_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_交易模板', 'tt_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_交易模板', 'tt_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '另存为_技术模板', 'ct_SaveAs');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '另存为_模板', 'template_SaveAs');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_报文', 'msg_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_业务模板', 'st_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_交易模板', 'tt_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_报文', 'msg_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '上传_交易', 'serviceFolder_Upload');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_模板', 'template_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_交易', 'serviceFolder_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_交易', 'serviceFolder_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_数据字典', 'dd_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_java文件', 'java_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_业务组件', 'bc_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_交易', 'serviceFolder_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '引用_模板', 'template_Ref');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_技术组件', 'tc_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_项目', 'project_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_项目', 'project_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_交易模板', 'tt_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_流程配置', 'tp_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_业务组件', 'bc_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_流程配置', 'tp_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_业务组件', 'bc_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_数据字典', 'dd_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '引用_技术模板', 'ct_Ref');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_技术组件', 'tc_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_交易', 'serviceFolder_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_组件包', 'cptPackage_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_交易模板', 'tt_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_组件包', 'cptPackage_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_技术组件', 'tc_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_业务模板', 'st_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_项目', 'project_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_组件包', 'cptPackage_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_交易模板', 'tt_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '调试_报文', 'msg_Debug');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_数据字典', 'dd_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '注册_组件包', 'cptPackage_Regist');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_模板', 'template_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_流程配置', 'tp_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_模板', 'template_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_数据字典', 'dd_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_组件包', 'cptPackage_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_平台', 'platform_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_数据实体类', 'edm_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_模板', 'template_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_流程配置', 'tp_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_技术模板', 'ct_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_组件包', 'cptPackage_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_平台', 'platform_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_技术组件', 'tc_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_业务模板', 'st_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_技术组件', 'tc_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_业务模板', 'st_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_项目', 'project_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_技术组件', 'tc_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_组件包', 'cptPackage_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_java文件', 'java_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_业务模板', 'st_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_模板', 'template_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_业务组件', 'bc_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_平台', 'platform_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_java文件', 'java_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_交易模板', 'tt_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_流程配置', 'tp_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_业务组件', 'bc_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_java文件', 'java_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_业务组件', 'bc_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_交易模板', 'tt_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_业务模板', 'st_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_模板', 'template_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_交易模板', 'tt_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_业务组件', 'bc_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_技术模板', 'ct_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_报文', 'msg_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_数据字典', 'dd_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_项目', 'project_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '另存为_业务模板', 'st_SaveAs');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_报文', 'msg_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '上传_项目', 'project_Upload');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_交易', 'serviceFolder_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_交易', 'serviceFolder_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_组件包', 'cptPackage_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_组件包', 'cptPackage_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_组件包', 'cptPackage_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_数据字典', 'dd_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_业务组件', 'bc_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_组件包', 'cptPackage_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_业务组件清单文档', 'bcptDetail_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_数据字典', 'dd_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_交易', 'serviceFolder_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_平台', 'platform_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_项目', 'project_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_项目', 'project_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_技术模板', 'ct_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_报文', 'msg_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_模板', 'template_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_组件包', 'cptPackage_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_银行', 'bank_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_平台', 'platform_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '注册_技术组件', 'tc_Regist');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_java文件', 'java_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_报文', 'msg_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_模板', 'template_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_技术模板', 'ct_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_业务模板', 'st_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_技术模板', 'ct_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_交易', 'serviceFolder_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_技术模板', 'ct_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_业务模板', 'st_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_交易', 'serviceFolder_Delete');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_银行', 'bank_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_项目', 'project_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_报文', 'msg_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_技术模板', 'ct_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '上传_流程配置', 'tp_Upload');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_项目', 'project_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_交易', 'serviceFolder_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_FTP', 'ftp_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_业务组件', 'bc_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_银行', 'bank_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_组件包', 'cptPackage_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_业务组件', 'bc_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_导航器', 'navigator_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_模板', 'template_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_业务模板', 'st_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_流程配置', 'tp_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_交易', 'serviceFolder_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_流程配置', 'tp_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_流程配置', 'tp_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_业务组件详情文档', 'bcptDoc_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_视图', 'view_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_java文件', 'java_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '打包_技术组件', 'tc_Pack');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_流程配置', 'tp_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_透视图', 'perspective_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_项目', 'project_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_银行', 'bank_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '部署_业务模板', 'st_Deploy');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_导航器', 'navigator_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导入_技术组件', 'tc_Import');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_流程配置', 'tp_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '快捷打开方式_数据字典', 'dd_FastOpen');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_技术模板', 'ct_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_交易详情文档', 'serviceDoc_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_技术组件', 'tc_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '创建_java文件', 'java_Create');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_java文件', 'java_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_交易模板', 'tt_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '配置_技术模板', 'ct_Config');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '另存为_交易模板', 'tt_SaveAs');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '编译_技术模板', 'ct_Compile');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_交易清单文档', 'serviceDetail_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_技术组件', 'tc_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '修改_java文件', 'java_Modify');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_模板', 'template_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '更新_业务模板', 'st_Update');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_流程配置', 'tp_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '查看_报文', 'msg_Browse');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '导出_银行', 'bank_Export');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '生成_项目', 'project_Generate');
INSERT INTO sys_idepermission (perm_name,perm_code) values ( '删除_交易模板', 'tt_Delete');
COMMIT;

-- ----------------------------
--  Table structure for sys_idepermission
--  IDE权限分配表
-- ----------------------------
drop table if exists sys_ideperm_role;
create table sys_ideperm_role (
   id SERIAL,
   role_id INTEGER not null,
   ideperm_id INTEGER not null,
   primary key (id)
);
comment on table sys_ideperm_role is 'IDE权限分配表';
comment on column sys_ideperm_role.id is 'PK';
comment on column sys_ideperm_role.role_id is 'FK，角色ID';
comment on column sys_ideperm_role.ideperm_id is 'FK，IDE权限ID';